<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>Login LDWS</title>
    
	
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<style type="text/css">
*{
	margin: 0px auto;
	padding: 0px auto;
}
body{
	text-align: center;
}
</style>

  <script type="text/javascript" src="js/jquery-1.9.1.js"></script>
  <script type="text/javascript">
  $(function(){
	  $("#submitUser").click(function(){
		  $.post("ldws/ldws_checkUser",{"user.username":$("#userName").val(),
			  "user.passwd":$("#userPwd").val()},function(data){
				  if(data.msg == "OK"){
					  $("#ldwsForm").submit();
				  }else{
					  alert(data.msg);
				  }
			  });
	  });
  });
  </script>
  </head>
  
  <body>
    <div>
    	<!-- 这个表单的action 是LDWS的登录页面的地址,后面的参数是控制LDWS登录的 -->
    	<form action="http://localhost:8080/LDWS/login.faces" method="post" id="ldwsForm">
				UserName:<input type="text" name="name" id="userName"><br>
				UserPwd&nbsp;:<input type="password" name="pwd" id="userPwd"><br>
				<input type="hidden" name="goSub" value="1">
				<input type="button" id="submitUser" value="SubUser">
		</form>
    </div>
  </body>
</html>
